package com.kl.feign;

import com.kl.domain.FreightDTO;
import com.kl.em.Result;
import com.kl.feign.fallback.FreightServiceFeignFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

//物价(运费) freight接口
@FeignClient(value = "kunlun-freight-service-b",fallback = FreightServiceFeignFallback.class)//服务名找项目
public interface FreightServiceFeign {
    //分页查询所有的物价(运费)
    @GetMapping("/freight/{pageNumber},/{pageSize}")
    Result findAll(@PathVariable("pageNumber") Integer pageNumber,@PathVariable("pageSize") Integer pageSize);
    //修改
    @PutMapping
     Result update(@RequestBody FreightDTO FreightDTO);
    //新增
    @PostMapping("/freight")
    Result add(@RequestBody FreightDTO FreightDTO);
    //单删
    @DeleteMapping("/freight/{id}")
    Result delete(@PathVariable("id") Integer id);

    //传id(物流方式),体积,重量  得到初步的物流费用 (未与距离关联)
    @GetMapping("/freight/getPrice")
    Result getPrice(@RequestParam Integer id,@RequestParam Integer volume,@RequestParam Integer kg);

}
